/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						 adv_actor_model_definition.h

	$Header: /heroes4/adv_actor_model_definition.h $

	$NoKeywords: $

 ************************************************************************/

#if !defined( ADV_ACTOR_MODEL_DEFINITION_H_INCLUDED )
#define ADV_ACTOR_MODEL_DEFINITION_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#pragma warning( disable: 4786 ) // Disable the ever so helpful "identifier was truncated to '255' characters" warning

#include <iosfwd>

#include "actor_model_definition.h"
#include "adv_actor_action.h"
#include "adventure_tile_size.h"
#include "resource_traits.h"
#include "screen_point.h"

// ------------------------------------------------------------------------------
// t_adv_actor_model_definition_traits struct - used to pass information to
// the t_actor_model_definition class template
// ------------------------------------------------------------------------------

struct t_adv_actor_model_definition_traits
{
	// Types
	typedef t_adv_actor_action_id	t_action_id;

	// Static data
	enum { k_action_count = k_adv_actor_action_count };
	enum { k_cell_width = k_adventure_tile_width };
	enum { k_cell_height = k_adventure_tile_height };
	enum { k_min_footprint_size = 1 };
	enum { k_max_footprint_size = 1 };
};

// ------------------------------------------------------------------------------
// t_adv_actor_model_definition class
// ------------------------------------------------------------------------------

class t_adv_actor_model_definition
	:	public t_actor_model_definition< t_adv_actor_model_definition_traits >
{
public:
	// Constructor
	t_adv_actor_model_definition();

	// Member functions
	t_screen_point const &	get_flag_offset() const;
	void					set_flag_offset( t_screen_point const & new_flag_offset );

private:
	// Data members
	t_screen_point	m_flag_offset;
};

inline t_adv_actor_model_definition::t_adv_actor_model_definition()
	:	m_flag_offset( 0, 0 )
{
	set_prewalk_length( 16 );
	set_walk_length( 32 );
	set_postwalk_length( 16 );
}

inline t_screen_point const & t_adv_actor_model_definition::get_flag_offset() const
{
	return m_flag_offset;
}

inline void t_adv_actor_model_definition::set_flag_offset( t_screen_point const & new_flag_offset )
{
	m_flag_offset = new_flag_offset;
}

bool read( std::streambuf & stream, t_adv_actor_model_definition & definition );
bool write( std::streambuf & stream, t_adv_actor_model_definition const & definition );

// ------------------------------------------------------------------------------
// t_resource_traits< t_adv_actor_model_definition >
// ------------------------------------------------------------------------------

template <>
struct t_resource_traits< t_adv_actor_model_definition >
{
	static char const prefix[];
	static char const extension[];
};

#endif // !defined( ADV_ACTOR_MODEL_DEFINITION_H_INCLUDED )
